import logging

import pytest
from api.ihrmLoginApi import IhrmLoginApi
from common.assertTools import common_assert
from common.readJsonTools import read_json_file
from config import BASE_PATH


class TestIhrmLogin(object):

    def setup_class(self):
        self.ihrm_login = IhrmLoginApi()

    filename = BASE_PATH + "/data/ihrmLoginData.json"
    data = read_json_file(filename)

    @pytest.mark.parametrize("desc,req_body,status_code,success,code,message", data)
    def test01_login_success(self, desc, req_body, status_code, success, code, message):
        resp = self.ihrm_login.login(req_body)
        print(desc, ":", resp.json())

